using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._GeostatisticalAnalystTools._Utilities
{
    /// <summary>
    /// <para>Subset Features</para>
    /// <para>Divides the original dataset into two parts: one part to be used to model the spatial structure and produce a surface, the other to be used to compare and validate the output surface.</para>
    /// <para>将原始数据集分为两部分：一部分用于对空间结构进行建模并生成表面，另一部分用于比较和验证输出表面。</para>
    /// </summary>    
    [DisplayName("Subset Features")]
    public class SubsetFeatures : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public SubsetFeatures()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_features">
        /// <para>Input features</para>
        /// <para>Points, lines, polygon features, or table from which to create a subset.</para>
        /// <para>要从中创建子集的点、线、面要素或表。</para>
        /// </param>
        /// <param name="_out_training_feature_class">
        /// <para>Output training feature class</para>
        /// <para>The subset of training features to be created.</para>
        /// <para>要创建的训练要素的子集。</para>
        /// </param>
        public SubsetFeatures(object _in_features, object _out_training_feature_class)
        {
            this._in_features = _in_features;
            this._out_training_feature_class = _out_training_feature_class;
        }
        public override string ToolboxName => "Geostatistical Analyst Tools";

        public override string ToolName => "Subset Features";

        public override string CallName => "ga.SubsetFeatures";

        public override List<string> AcceptEnvironments => ["extent", "geographicTransformations", "outputCoordinateSystem", "randomGenerator", "scratchWorkspace", "workspace"];

        public override object[] ParameterInfo => [_in_features, _out_training_feature_class, _out_test_feature_class, _size_of_training_dataset, _subset_size_units.GetGPValue()];

        /// <summary>
        /// <para>Input features</para>
        /// <para>Points, lines, polygon features, or table from which to create a subset.</para>
        /// <para>要从中创建子集的点、线、面要素或表。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_features { get; set; }


        /// <summary>
        /// <para>Output training feature class</para>
        /// <para>The subset of training features to be created.</para>
        /// <para>要创建的训练要素的子集。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output training feature class")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_training_feature_class { get; set; }


        /// <summary>
        /// <para>Output test feature class</para>
        /// <para>The subset of test features to be created.</para>
        /// <para>要创建的测试要素的子集。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output test feature class")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _out_test_feature_class { get; set; } = null;


        /// <summary>
        /// <para>Size of training  feature subset</para>
        /// <para>The size of the output training feature class, entered either as a percentage of the input features or as an absolute number of features.</para>
        /// <para>输出训练要素类的大小，以输入要素的百分比或要素的绝对数量形式输入。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Size of training  feature subset")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public double _size_of_training_dataset { get; set; } = 50;


        /// <summary>
        /// <para>Subset size units</para>
        /// <para><xdoc>
        ///   <para>Type of subset size.</para>
        ///   <bulletList>
        ///     <bullet_item>Percentage of input— The percentage of the input features that will be in the training dataset.</bullet_item><para/>
        ///     <bullet_item>Absolute value— The number of features that will be in the training dataset.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>子集大小的类型。</para>
        ///   <bulletList>
        ///     <bullet_item>输入百分比 - 将位于训练数据集中的输入要素的百分比。</bullet_item><para/>
        ///     <bullet_item>绝对值 - 训练数据集中将包含的特征数。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Subset size units")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _subset_size_units_value _subset_size_units { get; set; } = _subset_size_units_value._true;

        public enum _subset_size_units_value
        {
            /// <summary>
            /// <para>PERCENTAGE_OF_INPUT</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("PERCENTAGE_OF_INPUT")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>ABSOLUTE_VALUE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("ABSOLUTE_VALUE")]
            [GPEnumValue("false")]
            _false,

        }

        public SubsetFeatures SetEnv(object extent = null, object geographicTransformations = null, object outputCoordinateSystem = null, object randomGenerator = null, object scratchWorkspace = null, object workspace = null)
        {
            base.SetEnv(extent: extent, geographicTransformations: geographicTransformations, outputCoordinateSystem: outputCoordinateSystem, randomGenerator: randomGenerator, scratchWorkspace: scratchWorkspace, workspace: workspace);
            return this;
        }

    }

}